<template>
  <a href="javascript:;">
    <img :src="imgs" />
    <p class="name ellipsis">{{special.name}}</p>
    <p class="desc ellipsis">{{special.desc}}</p>
    <i class="iconfont icon-guanbi" @click="$emit('on-cancel', special)"></i>
  </a>
</template>

<script>
import { ref } from '@vue/reactivity'
export default {
  name: 'CollectSpecialItem',
  props: {
    special: {
      type: Object,
      default: () => {}
    }
  },
  setup () {
    const imgs = ref([])
    imgs.value = 'https://zhoushugang.gitee.io/erabbit-client-pc-static/uploads/img/index-new-pd0' + (Math.floor(Math.random() * 2) + 1) + '.png'
    return { imgs }
  },
  emits: ['on-cancel']
}
</script>

<style lang="less" scoped>
a {
  text-decoration: none;
  color: #333;
  outline: none;
  img {
    width: 294px;
    height: 140px;
    border-top-left-radius: 7px;
    border-top-right-radius: 7px;
  }
  p {
    // margin-top: 10px;
    padding: 0 10px;
    &.name {
    font-size: 16px;
    padding-top: 12px;
    }
    &.desc {
    color: #999;
    padding-top: 6px;
    }
  }
  i {
    position: absolute;
    right: 0;
    top: 0;
    width: 20px;
    height: 20px;
    background: #e4e4e4;
    color: #fff;
    line-height: 18px;
    display: none;
  }
  &:hover i{
    display: block;
  }
}
</style>
